<!-- 查询 content -->
{{ $contentSQL := "* FROM content WHERE id=? and status<3 order by status desc, sortNo desc" }}

{{ if eq .userType 1}}
  {{ $contentSQL ="* FROM content WHERE id=? order by sortNo desc" }}
{{end}}

{{ $content := selectOne "content" $contentSQL .UrlPathParam }}

{{ $prevContent := selectOne "content"  "id,title FROM content WHERE status in (1,2) and sortNo < ? order by sortNo desc " $content.SortNo  }}
{{ $nextContent := selectOne "content"  "id,title FROM content WHERE status in (1,2) and sortNo > ? order by sortNo asc " $content.SortNo  }}

<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <title>{{ $content.Title }}</title>
  <meta name="description" content="{{ $content.Description }}" />
  <meta name="keyword" content="{{ $content.Keyword }}" />

{{template "bodystart.html"  }}
			
<article id="{{ $content.Id }}" class="{{ $content.Id }} post type-post status-publish format-standard hentry category-uncategorized" itemtype="https://schema.org/CreativeWork" itemscope>
	<div class="inside-article">
					<header class="entry-header">
				<h1 class="entry-title" itemprop="headline">{{ $content.Title }}</h1>		<div class="entry-meta">
			<span class="posted-on"><time class="entry-date published" datetime="{{ $content.CreateTime }}" itemprop="datePublished">{{ $content.CreateTime }}</time></span> <span class="byline"> 
				
				
				<span class="author vcard" itemprop="author" itemtype="https://schema.org/Person" itemscope>
					
					<a class="url fn n" href="{{basePath}}{{ trimSlash $content.CategoryID }}" title="查看{{ $content.CategoryName }}栏目的所有文章" rel="author" itemprop="url"><span class="author-name" itemprop="name">{{ $content.CategoryName }}</span></a></span></span> 		</div>
					</header>
			
		<div class="entry-content" itemprop="text">

			{{ safeHTML $content.Content }}
		

        </div>

			<footer class="entry-meta" aria-label="条目 meta">
				<span>上次更新:  
					{{ if $content.UpdateTime }}
				      {{ slice $content.UpdateTime 0 10 }}
			        {{end}}
			</span> 		
			<nav id="nav-below" class="post-navigation" aria-label="文章">
			{{if $prevContent.Id }}
			<div class="nav-previous"><span class="prev"><a href="{{basePath}}{{ trimPrefixSlash $prevContent.Id}}" rel="prev">{{$prevContent.Title}}</a></span></div>
			{{end}}
			{{if $nextContent.Id }}
			<div class="nav-next"><span class="next"><a href="{{basePath}}{{ trimPrefixSlash $nextContent.Id}}" rel="next">{{$nextContent.Title}}</a></span></div>		
			{{end}}
		    </nav>
				</footer>
			</div>
</article>
		
{{template "bodyend.html" }}